package Code.Objects.Characters.Player.Weapons;

import org.jrabbit.standard.game.sound.Sound;


public class WeaponSoundPlayer
{
	private static boolean initialized = false;
	private static Sound[] shotgun = null;
	private static Sound[] machineGun = null;
	private static Sound[] laserRifle = null;
	
	public static void initialize()
	{
		if(!initialized)
		{
			shotgun = new Sound[3];
			shotgun[0] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Shotgun Fire.ogg");
			shotgun[1] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Reload 1.ogg");
			shotgun[2] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Empty 1.ogg");
			
			machineGun = new Sound[3];
			machineGun[0] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Machine Gun Fire.ogg");
			machineGun[1] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Reload 2.ogg");
			machineGun[2] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Empty 1.ogg");
				
			laserRifle = new Sound[1];
			laserRifle[0] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Weapons/Laser Rifle Fire.ogg");
			
			initialized = true;
		}
	}
	
	public static void playShotgunSound(float volume, int sound)
	{
		initialize();
		shotgun[sound].playOnce(1f, volume);
	}
	
	public static void playMachineGunSound(float volume, int sound)
	{
		initialize();
		machineGun[sound].playOnce(0.5f, volume);
	}
	
	public static void playLaserRifleSound(float volume, int sound)
	{
		initialize();
		laserRifle[sound].playOnce(1f, volume);
	}
}
